From: physikerwelt Date: Fri, 3 Jan 2014 17:05:24 +0000 (+0000) Subject: Add reference to the current user to the PageRenderingHash hook X-Git-Tag: 1.31.0-rc.0~17365 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=ce2b03fb0b9315e1fa7a0f2dc2007521d1aaa572;p=lhc%2Fweb%2Fwiklou.git Add reference to the current user to the PageRenderingHash hook To generate a user-dependent cache key it makes sense to pass a reference to the user object, since $wgUser is deprecated. Change-Id: I32a1df52912292230852c31d69968eeb312a4a97 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index fc4d40e3ae..fd434d46e4 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1793,7 +1793,8 @@ $queryInfo: the query parameters 'PageRenderingHash': Alter the parser cache option hash key. A parser extension which depends on user options should install this hook and append its values to the key. -$hash: reference to a hash key string which can be modified +&$confstr: reference to a hash key string which can be modified +$user: User (object) requesting the page 'ParserAfterParse': Called from Parser::parse() just after the call to Parser::internalParse() returns. diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 8393216875..c4e9a1ce9e 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -571,7 +571,7 @@ class ParserOptions { // Give a chance for extensions to modify the hash, if they have // extra options or other effects on the parser cache. - wfRunHooks( 'PageRenderingHash', array( &$confstr ) ); + wfRunHooks( 'PageRenderingHash', array( &$confstr, $this->getUser() ) ); // Make it a valid memcached key fragment $confstr = str_replace( ' ', '_', $confstr );